package com.jk;


import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice
public class MyController {

 /*   @ExceptionHandler(value = UnauthorizedException.class)//处理访问方法时权限不足问题
    public String defaultErrorHandler(HttpServletRequest req, Exception e)  {
        System.out.println("查询UnauthorizedException异常了");
        return "reject";
    }*/

    @ExceptionHandler(value = Exception.class)
    public String errorHandler(Exception ex) {
        System.out.println("查询全局异常了");
        return "reject";
    }
}
